<?php


namespace app\api\controller\xiluedu;


use app\common\controller\Api;
use app\common\model\xiluedu\Third;
use think\Db;
use think\Exception;
use function fast\array_get;

class OfflineOrder extends Api
{
    protected $noNeedLogin = [];
    protected $noNeedRight = ['*'];


    /**
     * 线下课程报名，课期报名
     */
    public function create_order()
    {
        $params = $this->request->param('');
        try {
            #報名
            $offline_order       = \app\common\model\xiluedu\OfflineOrder::createOrder($params);
        }catch (Exception $e){
            $this->error($e->getMessage());
        }
        $this->success('订单创建成功',$offline_order);
    }


    /**
     * 我的报名
     */
    public function lists(){
        $params = $this->request->param('');
        $this->success('查询成功',\app\common\model\xiluedu\OfflineOrder::lists($params));
    }

    /**
     * 我的报名
     */
    public function detail(){
        $order_id = $this->request->param('order_id');
        $this->success('查询成功',\app\common\model\xiluedu\OfflineOrder::detail($order_id));
    }

    /**
     * 我的报名
     */
    public function offline_orders(){
        $params = $this->request->param('');
        $this->success('查询成功',\app\common\model\xiluedu\OfflineOrder::offlineOrders($params));
    }

}